<!DOCTYPE HTML>
<html lang="en">
<head>

<meta charset="utf-8">
<title>jQuery File Upload Demo - Demo1</title>

<script src="../style/js/jquery.js"></script>
<script src="../style/js/bt.dwz.js"></script>

</head>
<script>
    function a(str) {
        alert("接收:" + str);
    }
    function a1(str) {
        alert("分页接收:" + str)
    }
    function b(str) {
        alert("发送" + str);
    }
</script>
<body>
<div class="container">
    <h1>jQuery File Upload Demo</h1>
    <h2 class="lead">Basic Plus UI version</h2>
    <ul class="nav nav-tabs">
        <li><a href="basic.html">Basic</a></li>
        <li><a href="basic-plus.html">Basic Plus</a></li>
        <li><a href="index.html">Basic Plus UI</a></li>
        <li class="active"><a href="demo1.html">demo1</a></li>
    </ul>
    <br>
    <blockquote>
        <p>一个例子:文件提交，表单提交。</p>
    </blockquote>
    <br>
    <form  class="" method="POST" actionTo="#" beforeSubmit="b(resque)" dataType="script" callback="a(respon);" action="test.js" ><!---->
        <div class="well">
            <noscript><input type="hidden" name="redirect" value="http://blueimp.github.io/jQuery-File-Upload/"></noscript>
            <div class="control-group">
              <label for="inputEmail" class="control-label horizontal">用户名</label>
              <div class="controls horizontal">
                <input type="text" name="name" placeholder="1~12位字符" id="inputEmail">
              </div>
            </div>
            <div class="control-group">
              <label for="inputPassword" class="control-label horizontal">密码</label>
              <div class="controls horizontal">
                <input type="password" name="pass" placeholder="8~12位数字/字母" id="inputPassword">
              </div>
            </div>
                <div class="fileupload-buttonbar">
                    <div class="col-lg-7">
                        <label for="inputfile" class="control-label horizontal relative">图片上传</label>
                        <div class="controls horizontal">
                            <span class="btn btn-success fileinput-button">
                                <i class="glyphicon glyphicon-plus"></i>
                                <span>浏览..</span>
                                <input file-type="3" type="file" name="files[]" server='server/php/' multiple>
                                <!--file-type:有1，2，3种类型，此处根据HTML结构为3; server:根据php文件对应位置设置即可-->
                            </span>
                            <button type="submit" class="btn btn-primary start">
                                <i class="glyphicon glyphicon-upload"></i>
                                <span>开始上传</span>
                            </button>
                            <button type="reset" class="btn btn-warning cancel">
                                <i class="glyphicon glyphicon-ban-circle"></i>
                                <span>取消上传</span>
                            </button>
                            <button type="button" class="btn btn-danger delete">
                                <i class="glyphicon glyphicon-trash"></i>
                                <span>删除</span>
                            </button>
                            <input type="checkbox" class="toggle">
                            <span class="fileupload-process"></span>
                        </div>
                    </div>
                    <div class="col-lg-5 fileupload-progress fade">
                        <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
                            <div class="progress-bar progress-bar-success" style="width:0%;"></div>
                        </div>
                        <div class="progress-extended">&nbsp;</div>
                    </div>
                </div>
                <div class="control-group">
                    <label for="inputfile" class="control-label horizontal relative">文件</label>
                    <div class="controls horizontal">
                        <table role="presentation" class="table table-striped"><tbody class="files"></tbody></table>
                    </div>
                </div>
            <div class="well">
                <label class="control-label horizontal relative" for="inputfile">&nbsp;</label>
                <button class="btn btn-info" type="submit">提交</button>
                <button class="btn btn-warning" type="reset">重置</button>
            </div>
        </div>
    </form>
    <br>
</div>
<!-- The blueimp Gallery widget -->
<div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls" data-filter=":even">
    <div class="slides"></div>
    <h3 class="title"></h3>
    <a class="prev">‹</a>
    <a class="next">›</a>
    <a class="close">×</a>
    <a class="play-pause"></a>
    <ol class="indicator"></ol>
</div>
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
    <tr class="template-upload fade">
        <td>
            <span class="preview"></span>
        </td>
        <td>
            <p class="name">{%=file.name%}</p>
            <strong class="error text-danger"></strong>
        </td>
        <td>
            <p class="size">Processing...</p>
            <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="progress-bar progress-bar-success" style="width:0%;"></div></div>
        </td>
        <td>
            {% if (!i && !o.options.autoUpload) { %}
                <button class="btn btn-primary start" disabled>
                    <i class="glyphicon glyphicon-upload"></i>
                    <span>开始</span>
                </button>
            {% } %}
            {% if (!i) { %}
                <button class="btn btn-warning cancel">
                    <i class="glyphicon glyphicon-ban-circle"></i>
                    <span>取消</span>
                </button>
            {% } %}
        </td>
    </tr>
{% } %}
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
    <tr class="template-download fade">
        <td>
            <span class="preview">
                {% if (file.thumbnailUrl) { %}
                    <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.thumbnailUrl%}"></a>
                {% } %}
            </span>
        </td>
        <td>
            <p class="name">
                {% if (file.url) { %}
                    <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}>{%=file.name%}</a>
                {% } else { %}
                    <span>{%=file.name%}</span>
                {% } %}
            </p>
            {% if (file.error) { %}
                <div><span class="label label-danger">Error</span> {%=file.error%}</div>
            {% } %}
        </td>
        <td>
            <span class="size">{%=o.formatFileSize(file.size)%}</span>
        </td>
        <td>
            {% if (file.deleteUrl) { %}
                <button class="btn btn-danger delete" data-type="{%=file.deleteType%}" data-url="{%=file.deleteUrl%}"{% if (file.deleteWithCredentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
                    <i class="glyphicon glyphicon-trash"></i>
                    <span>删除</span>
                </button>
                <input type="checkbox" name="delete" value="1" class="toggle">
            {% } else { %}
                <button class="btn btn-warning cancel">
                    <i class="glyphicon glyphicon-ban-circle"></i>
                    <span>取消</span>
                </button>
            {% } %}
        </td>
    </tr>
{% } %}
</script>


</body> 
</html>
